In general, fragmentation of data storage memory requires periodic or as-needed cleanup to merge non-contiguous areas of free memory into larger usable chunks of contiguous memory. This defragmentation process is typically very processor-intensive and thus tends to cause a temporary reduction of processing power available for other tasks.
When defragmentation occurs only on an as-needed basis, it is typically triggered by a scarcity of free memory that is in contiguous chunks big enough to be useful. In these circumstances, the memory unavailability (due to the memory fragmentation), the processor drain (due to the defragmentation operation), or both may cripple a system severely enough that it cannot respond appropriately to incoming commands or data. As a result, critical data may be lost, and time-critical functions may not be performed within the time required.
Periodic defragmentation, on the other hand, may avoid the extreme problems that may be faced by systems that only use as-needed defragmentation, but periodic defragmentation also suffers possible disadvantages. For example, even if defragmentation occurs periodically, the amount of time that it takes to defragment memory strongly depends on the utilization of the memory as well as the size and distribution of both the used and unused sections of memory. In other words, defragmentation time under these conditions tends to be non-deterministic. Knowing this, in order to try to insure that the time-critical functions are not adversely affected, a designer of a system that performs time-critical functions may reserve a larger percentage of the available processing resources to the task of defragmentation than may be actually necessary. As a result, processing resources that might otherwise be available to perform the time-critical functions are unavailable. Thus, it is desired to have a defragmentation method that operates in constant time, i.e., in which the time to defragment does not vary depending upon the amount or percentage of the memory currently in use.
Accordingly, there exists a need for methods, systems, and computer program products for providing memory management with constant defragmentation time.